@use '../shared.scss';
@use '@scss/common' as *;

.component {
  position: relative;
  display: inline-flex;
  flex-direction: column-reverse;
  gap: 0.5rem;
  width: 100%;

  &::before {
    content: '';
    width: calc(100% - 2px);
    position: absolute;
    height: 100%;
    top: 0;
    left: 1px;
    z-index: -1;
  }

  .errorAndLabel {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: 2rem;
    display: flex;
    align-items: center;
    pointer-events: none;
    transition: all 0.3s ease;

    @include mid-break {
      left: 1rem;
    }
  }

  .error,
  .textLabel {
    width: fit-content;
    margin: 0;
  }

  .actionsLabel {
    display: block;
    width: unset;
    pointer-events: none;
    margin-right: 0.75rem;
  }

  .textLabel {
    transition: all 0.3s ease;
    pointer-events: none;
    font-weight: 400;
  }

  .fullWidth {
    width: 100%;
  }

  .input {
    @include shared.formInput;
    & {
      padding: 1.5rem 2rem;
    }

    @include mid-break {
      padding: 1.5rem 1rem;
    }
  }

  .showError {
    .input {
      border-left: 2px solid var(--theme-error-500);
    }
  }

  .description {
    margin: 0;
  }

  .tooltipButton {
    width: 100%;
    height: 100%;
  }

  .type--hidden {
    display: none;
  }

  .iconWrapper {
    position: absolute;
    top: 50%;
    right: 1rem;
    transform: translate3d(0, -50%, 0);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
  }

  .icon {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 0.5rem;
    width: 0.5rem;
  }

  .suffix {
    @include small;
    & {
      display: flex;
      color: var(--theme-elevation-500);
    }
  }
}

.focused {
  .errorAndLabel {
    top: 25%;
    transform: translateY(-25%);
  }

  .error,
  .textLabel {
    font-size: 12px;
  }

  .actionsLabel {
    margin-right: 0.5rem;
  }

  .input {
    padding: 2rem 2rem 1rem 2rem;

    @include mid-break {
      padding: 2rem 1rem 1rem 1rem;
    }
  }
}
